<?php
namespace app\index\controller;

use think\Request;

class My extends Base
{


    public function info(){
        $puid = $this->user->puid;
        if($puid){
           $puser = model('user')->where('uid',$puid)->find();
           $this->assign('puser',$puser);
        }
        $this->assign('info',$this->user);
        return view('info');
    }




    public function upinfo(){
        $this->assign('info',$this->user);
        return view('upinfo');
    }


    public function saveInfo(){
        $data = Request::instance()->post();
        model('user')->where('uid',$this->uid)->update($data);
        $this->redirect('info');
    }





}
